package Test;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import com.db4o.ObjectContainer;
import com.sun.jersey.api.client.Client;

import nl.tue.be.ds.duraark.bSDD.ClientUtilities;
import nl.tue.be.ds.duraark.bSDD.DataBaseUtilities;
import nl.tue.be.ds.duraark.bSDD.dump.ConSearchPerTermCallable;



public class TestCallable {

	public static void main(String[] args) {
		/*String databaseName = "TestCall.db";
		ObjectContainer TestCall_db;
		DataBaseUtilities databaseUtilities = new DataBaseUtilities();
		databaseUtilities.setDatabase(databaseName);
		ExecutorService threadPool = Executors.newFixedThreadPool(5);
		ClientUtilities clientUtilities = new ClientUtilities();
		Client client = ClientUtilities.getClient();
		
		ConSearchPerTermCallable dptc = new ConSearchPerTermCallable("door");
		Future<Integer> future = threadPool.submit(dptc);
		Integer i = null;
		try {
			i = future.get();
		} catch (InterruptedException e) {
			
			e.printStackTrace();
		} catch (ExecutionException e) {
			
			e.printStackTrace();
		}
		 
		System.out.println(i + " concepts have been dumped into db");
		
		threadPool.shutdown();*/
		
		/*ConceptRelCallable crc = new ConceptRelCallable("21J3K0sMuHu000025QrE$V","parents",clientUtilities.getCookies(client));
		Future<HashMap<String, String>> future = threadPool.submit(crc);
		HashMap<String, String> hashmap = null;
		try {
			hashmap = future.get();
		} catch (InterruptedException e) {
			
			e.printStackTrace();
		} catch (ExecutionException e) {
			
			e.printStackTrace();
		} 


		if (hashmap == null)
			System.out.println("No parents rels");
		else{
			Iterator<String> iter = hashmap.keySet().iterator();
			while(iter.hasNext()){
				String conceptGuid = (String) iter.next();
				System.out.println("Parents rels: "+ conceptGuid + "<---->" + hashmap.get(conceptGuid));
			}
		}*/
		
		
		
		
		
		
		
		/*
		ExecutorService threadPool = Executors.newFixedThreadPool(5);
		DogCallable dogCallable = new DogCallable();
		CatCallable catCallable = new CatCallable();
		Future<String> dogfuture = threadPool.submit(dogCallable);
		Future<String> catfuture = threadPool.submit(catCallable);
		
		try {
			System.out.println("dogfuture "+dogfuture.get());
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ExecutionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		try {
			System.out.println("catfuture "+catfuture.get());
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ExecutionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		threadPool.shutdown();
	*/}

}
